/**
 * 
 */
package cn.edu.pku.action;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.edu.pku.dao.DepartmentDao;
import cn.edu.pku.dao.HumanDao;
import cn.edu.pku.dao.PositionDao;
import cn.edu.pku.dao.TitleDao;
import cn.edu.pku.model.Department;
import cn.edu.pku.model.Human;
import cn.edu.pku.model.Position;
import cn.edu.pku.model.Title;

import com.opensymphony.xwork2.ActionSupport;

/**
 * @author DreamJole Qi
 *
 * version 1.0
 */
public class ModifyHRRecordAction extends ActionSupport implements BaseAction {
	/**
	 * 
	 */
	private HttpServletRequest request;
	private HttpServletResponse response;
	private Map att;
	
	private HumanDao humanDao;
	private DepartmentDao departmentDao;
	private PositionDao positionDao;
	private TitleDao titleDao;
	private List<Position> positions;
	private List<Department> departments;
	private List<Title> titles;
	private Human human;
	private String humanId;
	
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub

		System.out.println(humanId);
		Integer id = Integer.parseInt(humanId);
		
		human = humanDao.get(id);
		positions = positionDao.findAll();
		departments = departmentDao.findAll();
		titles = titleDao.findAll();

		return SUCCESS;
	}

	


	public Human getHuman() {
		return human;
	}




	public void setHuman(Human human) {
		this.human = human;
	}




	public String getHumanId() {
		return humanId;
	}




	public void setHumanId(String humanId) {
		this.humanId = humanId;
	}




	public List<Position> getPositions() {
		return positions;
	}


	public void setPositions(List<Position> positions) {
		this.positions = positions;
	}




	public List<Department> getDepartments() {
		return departments;
	}




	public void setDepartments(List<Department> departments) {
		this.departments = departments;
	}




	public List<Title> getTitles() {
		return titles;
	}




	public void setTitles(List<Title> titles) {
		this.titles = titles;
	}




	public HumanDao getHumanDao() {
		return humanDao;
	}




	public void setHumanDao(HumanDao humanDao) {
		this.humanDao = humanDao;
	}




	public DepartmentDao getDepartmentDao() {
		return departmentDao;
	}


	public void setDepartmentDao(DepartmentDao departmentDao) {
		this.departmentDao = departmentDao;
	}


	public PositionDao getPositionDao() {
		return positionDao;
	}


	public void setPositionDao(PositionDao positionDao) {
		this.positionDao = positionDao;
	}


	public TitleDao getTitleDao() {
		return titleDao;
	}


	public void setTitleDao(TitleDao titleDao) {
		this.titleDao = titleDao;
	}


	@Override
	public void setServletRequest(HttpServletRequest request) {
		// TODO Auto-generated method stub
		this.request = request;
	}

	@Override
	public void setServletResponse(HttpServletResponse response) {
		// TODO Auto-generated method stub
		this.response = response;
	}

	@Override
	public void setSession(Map att) {
		// TODO Auto-generated method stub
		this.att = att;
	}
}
